public class BankAccount {
    private double balance;

    public BankAccount(double initialBalance) {
        this.balance = initialBalance;
    }

    public void deposit(double amount) {
        this.balance += amount;
        System.out.println("Deposited :$" + amount );
        System.out.println("New Balance :$" + balance);
    }

    public void withdraw(double amount){
        balance -= amount;
        System.out.println("Withdrawn :$" + amount);
        System.out.println("New Balance :$" + balance);
    }

    public double getBalance(){
        return balance;
    }

    public  void printBalance(){
        System.out.println("Balance (should not be directly accessible):$" + balance);
    }

    public static void main(String[] args) {
        BankAccount account = new BankAccount(1000.0);

        account.deposit(500.0);

        account.withdraw(200.0);

        System.out.println("Account balance:$"+account.getBalance());
    }
}
